<?php

// uncomment the following to define a path alias
 Yii::setPathOfAlias('local','path/to/local-folder');

 

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'OrderSystem',
//                   'defaultController' => 'site/main',
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
                                    //extensions yii maill
                                      'ext.yii-mail.YiiMailMessage',
                                      'ext.yii-mail.YiiMail',
                                
	),
	'modules'=>array(
//                                    'ajaxuploader'=>array(
//                                    //'userModel'=>'Biodata',  //change to the model that has the pix column
//                                    'LinkImage'=>'pix',  //column to save the filename
//                                    'folder'=>'image', //the dest folder(should be in the same folder level as protected folder)
//                ),
                /*
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'pass',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
                 
                 //Add by Thong Nguyen 21/7/2013
            /*
                'gii'=>array(
                    'generatorPaths'=>array(
                        'bootstrap.gii',
                    ),
                ),
             * 
             */
	),
    // application components
	'components'=>array(
                        //facebook
//                        'facebook'=>array(
//                            'class' => 'ext.yii-facebook-opengraph.SFacebook',
//                            'appId'=>'1420844314857282', // needed for JS SDK, Social Plugins and PHP SDK
//                            'secret'=>'57e4696e7a368c9dfa2c0f3e8b3e5454', // needed for the PHP SDK
//                            'fileUpload'=>false, // needed to support API POST requests which send files
//                            'trustForwarded'=>false, // trust HTTP_X_FORWARDED_* headers ?
                            //'locale'=>'en_US', // override locale setting (defaults to en_US)
//                            'jsSdk'=>true, // don't include JS SDK
//                            'async'=>true, // load JS SDK asynchronously
                            //'jsCallback'=>false, // declare if you are going to be inserting any JS callbacks to the async JS SDK loader
//                            'status'=>true, // JS SDK - check login status
//                            'cookie'=>true, // JS SDK - enable cookies to allow the server to access the session
//                            'oauth'=>true,  // JS SDK - enable OAuth 2.0
//                            'xfbml'=>true,  // JS SDK - parse XFBML / html5 Social Plugins
                            //'frictionlessRequests'=>true, // JS SDK - enable frictionless requests for request dialogs
//                            'html5'=>true,  // use html5 Social Plugins instead of XFBML
                            //'ogTags'=>array(  // set default OG tags
                                //'og:title'=>'MY_WEBSITE_NAME',
                                //'og:description'=>'MY_WEBSITE_DESCRIPTION',
                                //'og:image'=>'URL_TO_WEBSITE_LOGO',
                            //),
//                          ), //end facebook ext.
                         
                        //Add by dung3625@gmail.com
                        //send maill module
                        'mail' => array(
                                'class' => 'ext.yii-mail.YiiMail',
                                'transportType' => 'smtp',
                                'transportOptions'=>array(
//                                        'host'=>'smtp.gmail.com',
//                                        'host'=>'mb2d207.vdrs.net',
                                        'host'=>'mail.thinktodo.net',
//                                        'encryption'=>'ssl',
                                        'username'=>'ordersystem@thinktodo.net',
                                        'password'=>'nmthong76',
                                        'port'=>25,
                                ),
                        'viewPath' => 'application.views.site',
                        'logging' => true,
                        'dryRun' => false
),                                
                                    //Add by Thong Nguyen 21/7/2013
          
                /*
                'bootstrap'=>array(
                    'class'=>'bootstrap.components.Bootstrap',
                ),            
                */
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
           
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
                              // REST patterns
                              //  array('mobile/list', 'pattern'=>'api/<model:\w+>', 'verb'=>'GET'),
                              //  array('mobile/view', 'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'GET'),
                              //  array('mobile/update', 'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'PUT'),
                              //  array('mobile/delete', 'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'DELETE'),
                              //  array('mobile/create', 'pattern'=>'api/<model:\w+>', 'verb'=>'POST'), 
                              //Orther control
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
//                                                                             '/store/<action>' => '<controller>/<action>',
//                                                                             '/store/<action>/<child>' => 'store/category/slug/<action>/child/<child>',
                                                                            
			),
		),
             
             
/*
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
 */
		// uncomment the following to use a MySQL database

            'db'=>array(
                    /*
			'connectionString' => 'mysql:host=mysql.hostinger.vn;dbname=u975433402_order',
			'emulatePrepare' => true,
			'username' => 'u975433402_order',
			'password' => '1562006',
			'charset' => 'utf8',
                     */ 
//			'connectionString' => 'mysql:host=localhost;dbname=order_system',
//			'emulatePrepare' => true,
//			'username' => 'root',
//			'password' => '',
//			'charset' => 'utf8',     
                    'connectionString' => 'mysql:host=thinktodo.net;dbname=thinktod_location',
                    'emulatePrepare' => true,
                    'username' => 'thinktod_player',
                    'password' => '991985',
                    'charset' => 'utf8', 
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',        
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
            
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
//		'adminEmail'=>'think2do.contact.yahoo.com.vn',
                                        'adminEmail'=>'ordersystem@thinktodo.net',
                                       
                                       
	),
);